<?php
require_once '../../controllers/seguridad.php';
require_once("../layout/head.php");
?>
<script language="javascript" type="text/javascript" src="../../js/ajax.js"></script>
<?php
include_once '../../class/classFormulario.php';
include_once '../../class/classUtils.php';
$utils = new Utils();

$formulario = new Formulario();
$Usuarios = new Usuario();
$ext = $_REQUEST["ext"];

if (isset($_REQUEST["id"]) && $_REQUEST['id'] > 0) {
    $user = $Usuarios->loadById($_REQUEST['id']);
}
?>
<div id="generalcontent2">
    <div class="title">Usuarios</div>
    <div id="contenidos">
        <?php
        if (isset($_REQUEST['e']) && $_REQUEST['e'] != "") {
            $utils->mensaje($_REQUEST['e'], $_REQUEST['t']);
        }
        ?>	

        <?php
        if ($ext == 1) {
            echo '<div class="alerta">';
            echo "&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspUsted va activar el Usuario:  " . $user->USU_NOMBRES . " " . $user->USU_AP_PATERNO . " " . $user->USU_AP_MATERNO . "";
        }
        if ($ext == -1) {
            echo '<div class="alerta">';
            echo "&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbspUsted va desactivar el Usuario:  " . $user->USU_NOMBRES . " " . $user->USU_AP_PATERNO . " " . $user->USU_AP_MATERNO . "";
        }
        echo '</div><br>';
        ?>
        <form action="../../controllers/usuarios.php" class="niceform" method="post" name="formulario"  onSubmit="return checkFilledFields()" />

        <div class="formContainer">
            <div class="fieldRow">
                <input id="action" name="action" type="hidden" value="desactivar" />
                <input id="id" name="id" type="hidden" value="<?php echo $user->USU_ID; ?>" />
                <input id="r" name="r" type="hidden" value="<?php echo $_REQUEST['r']; ?>" />
                <input name="Guardar" type="submit" value="<?php
                if ($ext == 1) {
                    echo "Activar";
                } else {
                    echo "Desactivar";
                }
                ?>"  class="boton"/>
            </div>
        </div>
        </form>
        <?php
        require_once '../layout/pie.php';
        ?>